#include <iostream>
#include <typeinfo>
using namespace std;
class Base 
{
	public:
	Base(int data = 10):ma(data)
	{}
	~Base(){}
	void show()
	{
		cout<<"Base::show()"<<endl;
	}
	void show(int a)
	{
		cout<<"Base::show("<<a<<")"<<endl;
	}
	private:
	int ma;

};

class Derive:public Base
{
public:
	Derive(int data = 100):Base(data),mb(data)
	{
	}
	~Derive(){}
	void show(){cout<<"Derive::show()"<<endl;}
private:
	int mb;
};

int main()
{
	Base b;
	Derive d(50);
	Base *p = &d;
	p->show();
	p->show(99);

	cout<<sizeof(Base)<<endl;
	cout<<sizeof(Derive)<<endl;
	cout<<typeid(p).name()<<endl;
	//这里的返回是Derive
	cout<<typeid(*p).name()<<endl;
	return 0;


}
